#include <allegro.h>
/*       Game headers
*
*/
#include "consts.h"
#include "intro.h"
#include "menu.h"
#include "game.h"
#include "interEngine.h"
/*
*
*/


int main(int argc, char *argv[]) {
  srand(time(NULL));
  int res;
  engineStruct comm;
  
  /* Initializing the subsystem */
  allegro_init();
  set_color_depth(16);
  res = set_gfx_mode(GFX_AUTODETECT_WINDOWED, GAME_W, GAME_H, 0, 0);
  install_keyboard();
  install_timer();

  //
  comm.mode = MODE_INTRO;
  while(comm.mode != MODE_QUIT) {
    switch(comm.mode) {
      case MODE_INTRO: comm = intro(); break;
      case MODE_MENU: comm = menu(); break;
      case MODE_GAME: comm = game(comm.data); break;
      default: comm.mode = MODE_QUIT; break;
    }
  }

  return 0;
}
END_OF_MAIN()
